<?php 
header("content-type:text/html;charset=utf-8");
$dsn="mysql:host=127.0.0.1;dbname=zice;charset=utf8";
$redis=new Redis();
$redis->connect("127.0.0.1","6379");
$db=new PDO($dsn,'root','root');
$city=$_POST['city'];
$url="http://api.k780.com:88/?app=weather.future&weaid=$city&&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json";
$data=file_get_contents($url);
$data=json_decode($data,true);
// print_r($data);
$result=$data['result'];
print_r($result);die;
// foreach ($result as $key => $value) {
// 	$city=$value['citynm'];
// 	$week=$value['week'];
// 	$high=$value['temp_high'];
// 	$low=$value['temp_low'];
// 	$tianqi=$value['temperature'];
// 	$sql="insert into tian (city,week,high,low,tianqi) values('$city','$week','$high','$low','$tianqi')";
// 	$res=$db->exec($sql);
// }
// if($res){
// 	$data=array('code'=>1,'msg'=>"成功");
// }else{
// 	$data=array('code'=>0,'msg'=>"失败");
// }
echo json_encode($result);







 ?>